Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the codebase from Python to TypeScript, representing a major language change for the Cashfree Payment Gateway SDK. The changes convert Python model definitions to TypeScript interfaces and update the infrastructure accordingly.
Changes:
- Converted all Python model files in
cashfree_pg/models/to TypeScript interface definitions - Updated API response handling from Pydantic-based to TypeScript/Pydantic v2 generic types
- Modified CI configuration to support newer Python versions (3.9-3.13) and removed older versions (3.7-3.8)
Reviewed changes
Copilot reviewed 133 out of 856 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| cashfree_pg/models/*.py | Converted Python Pydantic models to TypeScript interfaces with type annotations |
| cashfree_pg/api_response.py | Updated ApiResponse class to use Pydantic v2 with generics and stricter typing |
| .travis.yml | Updated Python version support, removing 3.7-3.8 and adding 3.12-3.13 |
| cashfree_pg/models/init.py | Cleaned up whitespace formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @type {int} | ||
| * @memberof FetchSettlementsRequestPagination | ||
| */ | ||
| 'limit': int; | ||
| /** | ||
| * Specifies from where the next set of settlement details should be fetched. | ||
| * @type {str} | ||
| * @memberof FetchSettlementsRequestPagination | ||
| */ | ||
| 'cursor'?: str; |
There was a problem hiding this comment.
TypeScript does not have int or str types. These should be number and string respectively. This issue appears throughout all the converted TypeScript files.
| * @type {int} | |
| * @memberof FetchSettlementsRequestPagination | |
| */ | |
| 'limit': int; | |
| /** | |
| * Specifies from where the next set of settlement details should be fetched. | |
| * @type {str} | |
| * @memberof FetchSettlementsRequestPagination | |
| */ | |
| 'cursor'?: str; | |
| * @type {number} | |
| * @memberof FetchSettlementsRequestPagination | |
| */ | |
| 'limit': number; | |
| /** | |
| * Specifies from where the next set of settlement details should be fetched. | |
| * @type {string} | |
| * @memberof FetchSettlementsRequestPagination | |
| */ | |
| 'cursor'?: string; |
| * @type {List[str]} | ||
| * @memberof FetchSettlementsRequestFilters | ||
| */ | ||
| 'cf_settlement_ids'?: List[str]; | ||
| /** | ||
| * List of settlement UTRs for which you want the settlement reconciliation details. | ||
| * @type {List[str]} | ||
| * @memberof FetchSettlementsRequestFilters | ||
| */ | ||
| 'settlement_utrs'?: List[str]; | ||
| /** | ||
| * Specify the start date from when you want the settlement reconciliation details. | ||
| * @type {str} | ||
| * @memberof FetchSettlementsRequestFilters | ||
| */ | ||
| 'start_date'?: str; | ||
| /** | ||
| * Specify the end date till when you want the settlement reconciliation details. | ||
| * @type {str} | ||
| * @memberof FetchSettlementsRequestFilters | ||
| */ | ||
| 'end_date'?: str; |
There was a problem hiding this comment.
TypeScript uses Array<string> or string[] syntax, not Python's List[str]. This pattern appears throughout all converted files and needs correction.
| * @type {List[str]} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'cf_settlement_ids'?: List[str]; | |
| /** | |
| * List of settlement UTRs for which you want the settlement reconciliation details. | |
| * @type {List[str]} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'settlement_utrs'?: List[str]; | |
| /** | |
| * Specify the start date from when you want the settlement reconciliation details. | |
| * @type {str} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'start_date'?: str; | |
| /** | |
| * Specify the end date till when you want the settlement reconciliation details. | |
| * @type {str} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'end_date'?: str; | |
| * @type {Array<string>} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'cf_settlement_ids'?: Array<string>; | |
| /** | |
| * List of settlement UTRs for which you want the settlement reconciliation details. | |
| * @type {Array<string>} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'settlement_utrs'?: Array<string>; | |
| /** | |
| * Specify the start date from when you want the settlement reconciliation details. | |
| * @type {string} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'start_date'?: string; | |
| /** | |
| * Specify the end date till when you want the settlement reconciliation details. | |
| * @type {string} | |
| * @memberof FetchSettlementsRequestFilters | |
| */ | |
| 'end_date'?: string; |
| * @type {bool} | ||
| * @memberof EligibilityPaymentMethodsEntity | ||
| */ | ||
| 'eligibility'?: bool; | ||
| /** | ||
| * | ||
| * @type {str} | ||
| * @memberof EligibilityPaymentMethodsEntity | ||
| */ | ||
| 'entity_type'?: str; | ||
| /** | ||
| * | ||
| * @type {str} | ||
| * @memberof EligibilityPaymentMethodsEntity | ||
| */ | ||
| 'entity_value'?: str; |
There was a problem hiding this comment.
TypeScript uses boolean type, not bool. This issue occurs in multiple converted files.
| * @type {bool} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'eligibility'?: bool; | |
| /** | |
| * | |
| * @type {str} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'entity_type'?: str; | |
| /** | |
| * | |
| * @type {str} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'entity_value'?: str; | |
| * @type {boolean} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'eligibility'?: boolean; | |
| /** | |
| * | |
| * @type {string} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'entity_type'?: string; | |
| /** | |
| * | |
| * @type {string} | |
| * @memberof EligibilityPaymentMethodsEntity | |
| */ | |
| 'entity_value'?: string; |
| * @type {object} | ||
| * @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner | ||
| */ | ||
| 'tags'?: object; |
There was a problem hiding this comment.
In TypeScript, generic objects should be typed as Record<string, any> or a specific interface rather than object for better type safety.
| * @type {object} | |
| * @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner | |
| */ | |
| 'tags'?: object; | |
| * @type {{[key: string]: any}} | |
| * @memberof ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner | |
| */ | |
| 'tags'?: Record<string, any>; |
| * @type {float} | ||
| * @memberof DiscountDetails | ||
| */ | ||
| 'discount_value': float; | ||
| /** | ||
| * Maximum Value of Discount allowed. | ||
| * @type {float} | ||
| * @memberof DiscountDetails | ||
| */ | ||
| 'max_discount_amount': float; |
There was a problem hiding this comment.
TypeScript does not have a float type. Use number instead. This issue appears in multiple files.
| * @type {float} | |
| * @memberof DiscountDetails | |
| */ | |
| 'discount_value': float; | |
| /** | |
| * Maximum Value of Discount allowed. | |
| * @type {float} | |
| * @memberof DiscountDetails | |
| */ | |
| 'max_discount_amount': float; | |
| * @type {number} | |
| * @memberof DiscountDetails | |
| */ | |
| 'discount_value': number; | |
| /** | |
| * Maximum Value of Discount allowed. | |
| * @type {number} | |
| * @memberof DiscountDetails | |
| */ | |
| 'max_discount_amount': number; |
| from typing import Optional, Generic, Mapping, TypeVar | ||
| from pydantic import Field, StrictInt, StrictBytes, BaseModel |
There was a problem hiding this comment.
This file appears to still be Python code with Pydantic imports, but is among files being converted to TypeScript. The conversion is incomplete or the file extension is incorrect.
| """ # noqa: E501 | ||
|
|
||
|
|
||
| # import models into model package |
There was a problem hiding this comment.
This Python initialization file still contains Python imports but the models it's importing have been converted to TypeScript. This will cause import errors.
| - "3.9" | ||
| - "3.10" | ||
| - "3.11" | ||
| - "3.12" | ||
| - "3.13" |
There was a problem hiding this comment.
The CI configuration targets Python 3.13, but Python 3.13 is not released yet (current date is January 2026 per system instructions, but Python 3.13 stable was released in October 2024). The configuration should work, but verify the release dates align with testing requirements.
Raising PR to github